Fix/allow_registration_without_email_confirmation#103
Draft
gkijko wants to merge 11 commits into
Draft
Conversation
Post-release merge
Signed-off-by: dependabot[bot] <support@dependabot.com>
Signed-off-by: dependabot[bot] <support@github.com>
Currently if the setting REST_AUTH_TOOLKIT['email_confirmation_send_email'] is set to false, the registration view still requires an email_confirmation_class and it also skips the confirmation email (that is correct) but it does not set the user as active. This first change enables the automatic activation of users if the email_confirmation_send_email settings is set to false.
gkijko
commented
Aug 13, 2019
| @@ -51,12 +51,15 @@ def post(self, request): | |||
| user = deserializer.save() | |||
|
|
|||
| if self.email_confirmation_class is None: | |||
Author
There was a problem hiding this comment.
I think line 53 to 56 should go after the if get_setting('email_confirmation_send_email', True):
That way there would be no need to define the email_confirmation_class if the email_confirmation_send_email is set to False.
Other option would be to let is as is and let the programer decide how he wants to validate the emails.
Contributor
There was a problem hiding this comment.
I think the idea was that you always want a record in your DB (using your email confirmation class), but not always want to send actual email messages.
Contributor
merwok
reviewed
Aug 13, 2019
| send_email(request, user, getattr(user, email_field), confirmation) | ||
| else: | ||
| user.is_active = True | ||
| user.save() |
Contributor
There was a problem hiding this comment.
This wouldn’t be right for this class, but see the RestAuthToolkitMinimal app config class that doesn’t do user activation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.